namespace Collaboris.Saf.Actions.Wss.Tests.Generated
{
    using Engine.Report;

    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Saf.Tests;
    using Entities;
    using Wss.Web;

    /// <summary>
    /// This test was originally generated but has now been tested and verfiied by MJ
    /// </summary>
    [TestClass]
    public class SetMasterPageTest
    {
        [TestMethod]
        public void SetMasterPage_Test()
        {
            WSSTestAssistant<SetMasterPage, MasterPageInfo> setmasterpage =
                    new WSSTestAssistant<SetMasterPage, MasterPageInfo>(TestEnvironment.PublishingSite,
                        "SetMasterPageTestWeb", "BLANKINTERNET#0");

            using (setmasterpage)
            {
                string oldSiteMasterKey = setmasterpage.TestWeb.CustomMasterUrl;
                string oldSystemMasterKey = setmasterpage.TestWeb.MasterUrl;

                MacroReport doReport = setmasterpage.DoMacro();

                Assert.IsTrue(setmasterpage.TestWeb.CustomMasterUrl == setmasterpage.FirstEntity.SiteMasterPageUrl);
                Assert.IsTrue(setmasterpage.TestWeb.MasterUrl == setmasterpage.FirstEntity.SystemMasterPageUrl);

                MacroReport unDoReport = setmasterpage.UndoMacro();

                Assert.IsTrue(setmasterpage.TestWeb.CustomMasterUrl == oldSiteMasterKey);
                Assert.IsTrue(setmasterpage.TestWeb.MasterUrl == oldSystemMasterKey);

            }
        }

    }
}
